Optimal. Leaf size=229 \[ \frac{\left (56 a^2 b^2+a^4-2 b^4\right ) \cos (c+d x)}{10 b d}+\frac{\left (a^2+20 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^3}{20 a b d}+\frac{\left (a^2+28 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{20 b d}+\frac{a \left (2 a^2+83 b^2\right ) \sin (c+d x) \cos (c+d x)}{40 d}-\frac{3}{8} a x \left (4 a^2-3 b^2\right )-\frac{3 a^2 b \tanh ^{-1}(\cos (c+d x))}{d}-\frac{\cos (c+d x) (a+b \sin (c+d x))^4}{5 b d}-\frac{\cot (c+d x) (a+b \sin (c+d x))^4}{a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.677261, antiderivative size = 229, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.207, Rules used = {2894, 3049, 3033, 3023, 2735, 3770} \[ \frac{\left (56 a^2 b^2+a^4-2 b^4\right ) \cos (c+d x)}{10 b d}+\frac{\left (a^2+20 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^3}{20 a b d}+\frac{\left (a^2+28 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{20 b d}+\frac{a \left (2 a^2+83 b^2\right ) \sin (c+d x) \cos (c+d x)}{40 d}-\frac{3}{8} a x \left (4 a^2-3 b^2\right )-\frac{3 a^2 b \tanh ^{-1}(\cos (c+d x))}{d}-\frac{\cos (c+d x) (a+b \sin (c+d x))^4}{5 b d}-\frac{\cot (c+d x) (a+b \sin (c+d x))^4}{a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2894
Rule 3049
Rule 3033
Rule 3023
Rule 2735
Rule 3770
Rubi steps
\begin{align*} \int \cos ^2(c+d x) \cot ^2(c+d x) (a+b \sin (c+d x))^3 \, dx &=-\frac{\cos (c+d x) (a+b \sin (c+d x))^4}{5 b d}-\frac{\cot (c+d x) (a+b \sin (c+d x))^4}{a d}-\frac{\int \csc (c+d x) (a+b \sin (c+d x))^3 \left (-15 b^2+6 a b \sin (c+d x)+\left (a^2+20 b^2\right ) \sin ^2(c+d x)\right ) \, dx}{5 a b}\\ &=\frac{\left (a^2+20 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^3}{20 a b d}-\frac{\cos (c+d x) (a+b \sin (c+d x))^4}{5 b d}-\frac{\cot (c+d x) (a+b \sin (c+d x))^4}{a d}-\frac{\int \csc (c+d x) (a+b \sin (c+d x))^2 \left (-60 a b^2+27 a^2 b \sin (c+d x)+3 a \left (a^2+28 b^2\right ) \sin ^2(c+d x)\right ) \, dx}{20 a b}\\ &=\frac{\left (a^2+28 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{20 b d}+\frac{\left (a^2+20 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^3}{20 a b d}-\frac{\cos (c+d x) (a+b \sin (c+d x))^4}{5 b d}-\frac{\cot (c+d x) (a+b \sin (c+d x))^4}{a d}-\frac{\int \csc (c+d x) (a+b \sin (c+d x)) \left (-180 a^2 b^2+3 a b \left (29 a^2-4 b^2\right ) \sin (c+d x)+3 a^2 \left (2 a^2+83 b^2\right ) \sin ^2(c+d x)\right ) \, dx}{60 a b}\\ &=\frac{a \left (2 a^2+83 b^2\right ) \cos (c+d x) \sin (c+d x)}{40 d}+\frac{\left (a^2+28 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{20 b d}+\frac{\left (a^2+20 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^3}{20 a b d}-\frac{\cos (c+d x) (a+b \sin (c+d x))^4}{5 b d}-\frac{\cot (c+d x) (a+b \sin (c+d x))^4}{a d}-\frac{\int \csc (c+d x) \left (-360 a^3 b^2+45 a^2 b \left (4 a^2-3 b^2\right ) \sin (c+d x)+12 a \left (a^4+56 a^2 b^2-2 b^4\right ) \sin ^2(c+d x)\right ) \, dx}{120 a b}\\ &=\frac{\left (a^4+56 a^2 b^2-2 b^4\right ) \cos (c+d x)}{10 b d}+\frac{a \left (2 a^2+83 b^2\right ) \cos (c+d x) \sin (c+d x)}{40 d}+\frac{\left (a^2+28 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{20 b d}+\frac{\left (a^2+20 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^3}{20 a b d}-\frac{\cos (c+d x) (a+b \sin (c+d x))^4}{5 b d}-\frac{\cot (c+d x) (a+b \sin (c+d x))^4}{a d}-\frac{\int \csc (c+d x) \left (-360 a^3 b^2+45 a^2 b \left (4 a^2-3 b^2\right ) \sin (c+d x)\right ) \, dx}{120 a b}\\ &=-\frac{3}{8} a \left (4 a^2-3 b^2\right ) x+\frac{\left (a^4+56 a^2 b^2-2 b^4\right ) \cos (c+d x)}{10 b d}+\frac{a \left (2 a^2+83 b^2\right ) \cos (c+d x) \sin (c+d x)}{40 d}+\frac{\left (a^2+28 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{20 b d}+\frac{\left (a^2+20 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^3}{20 a b d}-\frac{\cos (c+d x) (a+b \sin (c+d x))^4}{5 b d}-\frac{\cot (c+d x) (a+b \sin (c+d x))^4}{a d}+\left (3 a^2 b\right ) \int \csc (c+d x) \, dx\\ &=-\frac{3}{8} a \left (4 a^2-3 b^2\right ) x-\frac{3 a^2 b \tanh ^{-1}(\cos (c+d x))}{d}+\frac{\left (a^4+56 a^2 b^2-2 b^4\right ) \cos (c+d x)}{10 b d}+\frac{a \left (2 a^2+83 b^2\right ) \cos (c+d x) \sin (c+d x)}{40 d}+\frac{\left (a^2+28 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{20 b d}+\frac{\left (a^2+20 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^3}{20 a b d}-\frac{\cos (c+d x) (a+b \sin (c+d x))^4}{5 b d}-\frac{\cot (c+d x) (a+b \sin (c+d x))^4}{a d}\\ \end{align*}
Mathematica [A] time = 2.96152, size = 194, normalized size = 0.85 \[ \frac{-20 b \left (b^2-30 a^2\right ) \cos (c+d x)+10 \left (4 a^2 b-b^3\right ) \cos (3 (c+d x))+480 a^2 b \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )-480 a^2 b \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )-40 a^3 \sin (2 (c+d x))+80 a^3 \tan \left (\frac{1}{2} (c+d x)\right )-80 a^3 \cot \left (\frac{1}{2} (c+d x)\right )-240 a^3 c-240 a^3 d x+120 a b^2 \sin (2 (c+d x))+15 a b^2 \sin (4 (c+d x))+180 a b^2 c+180 a b^2 d x-2 b^3 \cos (5 (c+d x))}{160 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.099, size = 216, normalized size = 0.9 \begin{align*} -{\frac{{a}^{3} \left ( \cos \left ( dx+c \right ) \right ) ^{5}}{d\sin \left ( dx+c \right ) }}-{\frac{{a}^{3} \left ( \cos \left ( dx+c \right ) \right ) ^{3}\sin \left ( dx+c \right ) }{d}}-{\frac{3\,{a}^{3}\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2\,d}}-{\frac{3\,{a}^{3}x}{2}}-{\frac{3\,{a}^{3}c}{2\,d}}+{\frac{{a}^{2}b \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{d}}+3\,{\frac{{a}^{2}b\cos \left ( dx+c \right ) }{d}}+3\,{\frac{{a}^{2}b\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{d}}+{\frac{3\,a{b}^{2}\sin \left ( dx+c \right ) \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{4\,d}}+{\frac{9\,a{b}^{2}\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{8\,d}}+{\frac{9\,a{b}^{2}x}{8}}+{\frac{9\,a{b}^{2}c}{8\,d}}-{\frac{ \left ( \cos \left ( dx+c \right ) \right ) ^{5}{b}^{3}}{5\,d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.54116, size = 193, normalized size = 0.84 \begin{align*} -\frac{32 \, b^{3} \cos \left (d x + c\right )^{5} + 80 \,{\left (3 \, d x + 3 \, c + \frac{3 \, \tan \left (d x + c\right )^{2} + 2}{\tan \left (d x + c\right )^{3} + \tan \left (d x + c\right )}\right )} a^{3} - 80 \,{\left (2 \, \cos \left (d x + c\right )^{3} + 6 \, \cos \left (d x + c\right ) - 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} a^{2} b - 15 \,{\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} a b^{2}}{160 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.92587, size = 464, normalized size = 2.03 \begin{align*} -\frac{30 \, a b^{2} \cos \left (d x + c\right )^{5} + 60 \, a^{2} b \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) - 60 \, a^{2} b \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) - 5 \,{\left (4 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} + 15 \,{\left (4 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right ) +{\left (8 \, b^{3} \cos \left (d x + c\right )^{5} - 40 \, a^{2} b \cos \left (d x + c\right )^{3} - 120 \, a^{2} b \cos \left (d x + c\right ) + 15 \,{\left (4 \, a^{3} - 3 \, a b^{2}\right )} d x\right )} \sin \left (d x + c\right )}{40 \, d \sin \left (d x + c\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.31719, size = 466, normalized size = 2.03 \begin{align*} \frac{120 \, a^{2} b \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) + 20 \, a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 15 \,{\left (4 \, a^{3} - 3 \, a b^{2}\right )}{\left (d x + c\right )} - \frac{20 \,{\left (6 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + a^{3}\right )}}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )} + \frac{2 \,{\left (20 \, a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{9} - 75 \, a b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{9} + 240 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{8} - 40 \, b^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{8} + 40 \, a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{7} - 30 \, a b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{7} + 720 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{6} + 880 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{4} - 80 \, b^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{4} - 40 \, a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 30 \, a b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 560 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 20 \, a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 75 \, a b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 160 \, a^{2} b - 8 \, b^{3}\right )}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1\right )}^{5}}}{40 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]